BIN=bin
SUDO=sudo
COPY=cp -fr
PHP_DIR=php
CGI_DIR=cgi-bin
PHP_DEPLOY_DIR=/var/www
CGI_DEPLOY_DIR=/usr/lib/cgi-bin

RESOURCES_DIR=resources

deploy: all
	$(SUDO) $(COPY) $(BIN)/*.cgi $(CGI_DEPLOY_DIR)
	$(SUDO) chmod +x $(CGI_DEPLOY_DIR)/*.cgi
	$(SUDO) $(COPY) $(PHP_DIR)/* $(PHP_DEPLOY_DIR)
	$(SUDO) $(COPY) $(BIN)/paperserver $(PHP_DEPLOY_DIR)


all: $(BIN)
	(cd c/source;	make)
	(cd cgi/src;	make)
	(cd java/Hotel;	make)
	cp -fr c/bin/* $(BIN)
	cp -fr java/Hotel/bin/* $(BIN)
	cp -fr cgi/bin/* $(BIN)


$(BIN):
	mkdir $(BIN)



clean:
	(cd c/source;	make clean)
	(cd cgi/src;	make clean)
	(cd java/Hotel;	make clean)
	$(SUDO) rm -fr $(PHP_DEPLOY_DIR)/* $(CGI_DEPLOY_DIR)/*
	

